package com.acme.bankapp.service.bank;

import com.acme.bankapp.domain.bank.Account;

public class SavingAccount implements Account {

	int balance;
	
	public SavingAccount(int balance){
		this.balance=balance;
	}
	
	@Override
	public int getBalance() {
		return balance;
	}

	@Override
	public void deposit(double x) {
		balance +=x;
	}

	@Override
	public void withdraw(double x) {
		if(x<=balance){
			balance -=x;
		}
		else{
			System.out.println("Value " + x + " more than your balance");
		}
	}

	@Override
	public double maximumAmountToWithdraw() {
		return balance;
	}

}
